# Contributor: drebrez <drebrez@gmail.com>
# Maintainer: drebrez <drebrez@gmail.com>
pkgname=apk-file
pkgver=0.1.3
pkgrel=0
pkgdesc="Command line front end for pkgs.alpinelinux.org"
url="https://github.com/jessfraz/apk-file"
arch="all"
license="MIT"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/jessfraz/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/go/src/github.com/jessfraz/$pkgname"
options="!check"

prepare() {
	mkdir -p "$srcdir/go/src/github.com/jessfraz"
	mv "$srcdir/$pkgname-$pkgver" "$builddir"
}

build() {
	export GOPATH="$srcdir/go"
	cd "$builddir"
	go build -o apk-file -ldflags "-X main.version=$pkgver" main.go
}

package() {
	install -Dm755 "$builddir/apk-file" \
		"$pkgdir/usr/bin/apk-file"
}

sha512sums="ff688ed064e961321ef984f7cbd2dd6013bbdd7485aa00303039857ce96e5fcda8979e8102f29a66951c377a8f71780218a023833f6eebdf901ffced0ded0d19  apk-file-0.1.3.tar.gz"
